<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title> 文本操作 </title>
    <style>
        body{
            text-align: center;
        }
        .box{
            width: 200px;
            height: 200px;
            border: 1px solid red;
            margin: 40px auto;
        }
    </style>
</head>
<body>
    <div class="box"></div>
    <button id="setting">设置</button>
    <button id="read">读取</button>
</body>
<script src="../lib/font/jquery.min.js"></script>
<script>
    $(function(){
        $("#setting").click(function(){
            // $(".box").text('你好啊');
            $(".box").html('<h1> 我很好啊 </h1>');
         });
         $("#read").click(function(){
            // let text = $(".box").text();
            let text = $(".box").html();
             console.log(text);
             
         })
        
    });
</script>
</html>